using Unity.Entities;
using UnityEngine;

public class EntityReferencesAuthoring : MonoBehaviour
{
    public GameObject enemyPrefab;
    public GameObject bulletPrefab;
    public class Baker : Baker<EntityReferencesAuthoring>
    {
        public override void Bake(EntityReferencesAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.Dynamic);
            AddComponent(entity, new EntityReferences
            {
                enemyEntity = GetEntity(authoring.enemyPrefab, TransformUsageFlags.Dynamic),
                bulletEntity = GetEntity(authoring.bulletPrefab, TransformUsageFlags.Dynamic),
            });
        }
    }
}

public struct EntityReferences : IComponentData
{
    public Entity enemyEntity;
    public Entity bulletEntity;
}